package com.sebastian.studies.ch1;

import java.util.Scanner;

public class HelloWorld {

	public static void main(String[] args) {
		System.out.println("Java Works as expected!");

		System.out.println("==================1===================");

		System.out.println("Java printing and calculating\n");
		int radius = 7;
		final double PI = 3.14;
		
		double area = radius * radius * PI;

		System.out.println("Area is: " + area);

		System.out.println("==================2===================");
		System.out.println("Java printing and calculating\n");

		int time = 1000;
		int minutes = time/60;
		int seconds = time%60;

		System.out.println("Time: " + time + "s.\n"
			+ "Counts to: " + minutes + " minutes" +
				" and " + seconds + " seconds");
		
		System.out.println("==================3===================");
		System.out.println("Shorthand Operation\n");
		int i = 1;
		i += 9;
		System.out.println("Farenhait to Celcius: " + i + "\n");

		System.out.println("==================4===================");
		System.out.println("Type casting\n");

		double numbrDbl = 11.21;
		int y = (int)numbrDbl;
		System.out.println("Casting gives: " + y + "\n");

		System.out.println("==================5===================");
		System.out.println("Scanner");

		Scanner input = new Scanner(System.in);
		int age;
		String name;

		System.out.println("What is your name?\n");
		name = input.nextLine();
		System.out.println("Hello " + name + "\n" +
			"and how about your age?");
		age = input.nextInt();
		System.out.println("\nAge: " + age);
		input.close();
	}

}
